package com.eorchis.module.reminduserlink.ui.commond;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.commons.beanutils.BeanUtils;
import org.codehaus.jackson.map.ObjectMapper;

import com.eorchis.core.page.commond.SortInfoBean;
import com.eorchis.core.ui.commond.IQueryCommond;
import com.eorchis.core.ui.commond.impl.BasePageQueryCommond;

/**
 * Title: RemindUserLinkCommond<br>
 * Description: 提醒用户关联表Commond<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author RongSL
 * @createDate 2016-05-06
 * @version $Revision$
 */
public class RemindUserLinkQueryCommond extends BasePageQueryCommond implements IQueryCommond {

	private String[] searchRemindUserIds;	

	/**
	 * 查询条件：查看状态
	 */
	private Integer searchLookState;			
	/**
	 * 查询条件：提醒表内容
	 */
	private String searchRemindValue;		
	/**
	 * 查询条件：提醒表接收人ID
	 */
	private String searchReplyUserid;		
	
	private String searchRemindType;//提醒类型
	private String searchRemindCategory;//提醒分类

	public String getSearchRemindType() {
		return searchRemindType;
	}
	public void setSearchRemindType(String searchRemindType) {
		this.searchRemindType = searchRemindType;
	}
	public String getSearchRemindCategory() {
		return searchRemindCategory;
	}
	public void setSearchRemindCategory(String searchRemindCategory) {
		this.searchRemindCategory = searchRemindCategory;
	}
	
	public String[] getSearchRemindUserIds() {
		return searchRemindUserIds;
	}
	public void setSearchRemindUserIds(String[] searchRemindUserIds) {
		this.searchRemindUserIds = searchRemindUserIds;
	}
	
	public Integer getSearchLookState() {
		return searchLookState;
	}
	public void setSearchLookState(Integer searchLookState) {
		this.searchLookState = searchLookState;
	}

	public String getSearchRemindValue() {
		return searchRemindValue;
	}
	public void setSearchRemindValue(String searchRemindValue) {
		this.searchRemindValue = searchRemindValue;
	}
	public String getSearchReplyUserid() {
		return searchReplyUserid;
	}
	public void setSearchReplyUserid(String searchReplyUserid) {
		this.searchReplyUserid = searchReplyUserid;
	}

	/**
	 * EXT 页面排序
	 */
	private SortInfoBean sortInfo = null;
	
	/**
	 * 获取排序内容
	 * 
	 * @return
	 * @author HuangS
	 * @date Jul 20, 2012
	 */
	public SortInfoBean getSortInfos() {
		return this.sortInfo;
	}
	/**
	 * 设置排序内容
	 * 
	 * @param sort
	 * @author HuangS
	 * @date Jul 25, 2012
	 */
	@SuppressWarnings("unchecked")
	public void setSort(String sort) {
		if (sort != null && !"".equals(sort)) {
			sortInfo = new SortInfoBean();
			ObjectMapper objectMapper = new ObjectMapper();
			try {
				List<LinkedHashMap<String, Object>> list = objectMapper.readValue(sort, List.class);
				for (int i = 0; i < list.size(); i++) {
					Map<String, Object> map = list.get(i);
					Set<String> set = map.keySet();
					for (Iterator<String> it = set.iterator(); it.hasNext();) {
						String key = it.next();
						BeanUtils.setProperty(sortInfo, key, map.get(key));
					}
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}
